package com.example.entity.body.impl;

import com.example.constant.BodyTypeConstant;
import com.example.constant.MessageConstant;
import com.example.entity.body.Body;

public class InitBody implements Body {
	private char type;
	private long costModelID;
	private long equipmentID;
	private byte electricPortNum;
	private byte electricModel;
	private char addr;
	
	private byte end = MessageConstant.BODY_END_TYPE;

	public final char getType() {
		return type;
	}

	public final void setType(char type) {
		this.type = type;
	}

	public final long getCostModelID() {
		return costModelID;
	}

	public final void setCostModelID(long costModelID) {
		this.costModelID = costModelID;
	}

	public final long getEquipmentID() {
		return equipmentID;
	}

	public final void setEquipmentID(long equipmentID) {
		this.equipmentID = equipmentID;
	}

	public final byte getElectricPortNum() {
		return electricPortNum;
	}

	public final void setElectricPortNum(byte electricPortNum) {
		this.electricPortNum = electricPortNum;
	}

	public final byte getElectricModel() {
		return electricModel;
	}

	public final void setElectricModel(byte electricModel) {
		this.electricModel = electricModel;
	}

	public final char getAddr() {
		return addr;
	}

	public final void setAddr(char addr) {
		this.addr = addr;
	}

	@Override
	public final int getBodyType() {
		// TODO Auto-generated method stub
		return BodyTypeConstant.INIT;
	}

	@Override
	public String toString() {
		return "InitBody [type=" + type + ", costModelID=" + costModelID + ", equipmentID=" + equipmentID
				+ ", electricPortNum=" + electricPortNum + ", electricModel=" + electricModel + ", addr=" + addr + "]";
	}

	@Override
	public boolean equals(Object obj) {

		if (obj == null)
			return false;
		if (!(obj instanceof InitBody)) {
			return false;
		}
		InitBody other = (InitBody) obj;
		if (addr != other.addr)
			return false;
		if (costModelID != other.costModelID)
			return false;
		if (electricModel != other.electricModel)
			return false;
		if (electricPortNum != other.electricPortNum)
			return false;
		if (equipmentID != other.equipmentID)
			return false;
		if (type != other.type)
			return false;
		return true;
	}

}
